Processes

Back to se350

Requirements

Managing Processes

/****************************************
* -------------- task VM ---------------
*****************************************/
rom_desc_tsk rom_desc_task_vm = {
TASK_VM_PRIO,
_stack_vm,
TASK_VM,
READY,
TASK_VM_ID,
sizeof(_stack_vm)
};
```

Spawning

Termination

Queueing

Resource management

Process creation

  1. Assign unique PID
  2. Allocate space
  3. Initialize PCB
  4. Set up appropriate links (e.g. add new process to linked list for scheduling queue)
  5. Create and expand other data structures, e.g. accounting file

When to switch processes

Steps to switch

  1. Save context of processor (PC and other registers)
  2. Update PCB of the process currently running
  3. Move PCB to appropriate queue: ready, blocked, ready/suspend
  4. Seect another process to execute

Change of Process State